const fs = require('fs')
let newData = ""
fs.readFile('./成绩.txt', 'utf8', (err, msg) => {
    if (err) {
        console.log('文件读取失败');
    } else {
        let arr = msg.split(' ')
        arr = arr.map(item => {
            return item.replace(/-/, ":")
        })
        newData = arr.join('\n')
        fs.writeFile('./newScore.txt', newData, "utf8", (err) => {
            if (err) {
                console.log("文件写入失败");
            } else {
                console.log("文件写入成功");
            }
        })
    }
}) 